package rs.udd.service.document.indexer.handler;

import java.io.File;

import org.apache.lucene.document.Document;

import rs.udd.exceptions.IncompleteIndexDocumentException;
import rs.udd.service.dto.advert.AdvertDto;

public abstract class DocumentHandler {

	/**
	 * Only for parsing Text from document
	 * @param file
	 * @return
	 * @throws IncompleteIndexDocumentException
	 */
	public abstract Document getDocument(File file) throws IncompleteIndexDocumentException;
	
	/**
	 * For parsing all required fields from document. See also {@link DocumentHandler#getDocument(File)}
	 * @param file
	 * @param advertDto
	 * @return
	 * @throws IncompleteIndexDocumentException
	 */
	public abstract Document getDocument(File file, AdvertDto advertDto) throws IncompleteIndexDocumentException;
	
}
